package com.yonyou.state.constant;

/**
 * 工单状态枚举
 */
public enum SOStatusEnum {

    created("created", "UID:P_PES-BE_18B2024E04C80032","待处理",1),//@notranslate
    confirmed("confirmed", "UID:P_PES-BE_181DE8220528011A","已确认",2),//@notranslate
    dispatched("dispatched", "UID:P_PES-BE_181DE8220528011B","已派工",3),//@notranslate
    received("received", "UID:P_PES-BE_181DE8220528011C","已接收",4),//@notranslate
    signed("signed", "UID:P_PES-BE_181DE8220528011D","已签到",5),//@notranslate
    reported("reported", "UID:P_PES-BE_181DE8220528011E","已汇报",6),//@notranslate
    completed("completed", "UID:P_PES-BE_181DE8220528011F","已完工",7),//@notranslate
    evaluated("evaluated", "UID:P_PES-BE_181DE82205280120","已评价",8),//@notranslate
    closed("closed", "UID:P_PES-BE_181DE82205280118","关闭",9);//@notranslate

    private String value;
    private String desc;
    private String type = "sms.so.status";
    private int statusOrder;

    public int getStatusOrder() {
        return statusOrder;
    }
    public String getType() {
        return type;
    }


    private String defaultDesc;


    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDefaultDesc() {
        return defaultDesc;
    }

    public void setDefaultDesc(String defaultDesc) {
        this.defaultDesc = defaultDesc;
    }


    public String getDesc() {
        return desc /* desc */;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    SOStatusEnum(String value, String desc, String defaultDesc,int statusOrder) {
        this.value = value;
        this.desc = desc;
        this.defaultDesc = defaultDesc;
        this.statusOrder =statusOrder;
    }

    public static String getName(String value) {
        for (SOStatusEnum c : SOStatusEnum.values()) {
            if (c.value.equals(value)) {
                return c.getDesc();
            }
        }
        return null;
    }

    public static SOStatusEnum matchSOStatusValue(String soStatusStr) {
        for (SOStatusEnum soStatusValue : SOStatusEnum.values()) {
            if (soStatusValue.name().equalsIgnoreCase(soStatusStr)) {
                return soStatusValue;
            }
        }
        return null;
    }

}

